-
Notifications
You must be signed in to change notification settings - Fork 789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add calibrate with jacobians for Cal3Bundler #539
Conversation
Okay so this is breaking because calling code is getting confused which version of @dellaert should I merge the two |
Yes :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not clear to me whether in the Jacobian section you should be using the initial estimate (x,y) or the final iterate. If the latter, then you should re-use the variables g, rr, etc.
@dellaert great call on the Implicit Function theorem. Thinking in math was the right approach 😄 |
f2f98af
to
8634d3f
Compare
CHECK(assert_equal(numerical2,K.D2d_intrinsic(p),1e-7)); | ||
Matrix Dcombined(2,5); | ||
Dcombined << Dp, Dcal; | ||
CHECK(assert_equal(Dcombined,K.D2d_intrinsic_calibration(p),1e-7)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These methods are deprecated, which is why I removed these tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome. You need to use fixed-size matrices if you know sizes, esp in functions like these that could be called for all points.
Maybe make an issue to hunt down and fix other implicit theorem instances?
gtsam/geometry/Cal3Bundler.cpp
Outdated
// df/pi = -I (pn and pi are independent args) | ||
// Dcal = -inv(H_uncal_pn) * df/pi = -inv(H_uncal_pn) * (-I) = inv(H_uncal_pn) | ||
// Dp = -inv(H_uncal_pn) * df/K = -inv(H_uncal_pn) * H_uncal_K | ||
Matrix H_uncal_K, H_uncal_pn; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These matrices should be fixed-size. Also, cache H_uncal_pn here? (In a fixed size Matrix) finally, you can avoid calculating H_uncal_K using `Dcal ? &H_uncal_K : nullptr in first argument below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick question about caching H_uncal_pn: should I be calling uncalibrate with H_uncal_pn always?
Approved as I’ll trust you’ll make those final changes |
Added an additional
calibrate
method forCal3Bundler
which compute jacobians.Since the normal calibration method is iterative, I have approximated the jacobian as if a single iteration step has occurred, which should suffice assuming the projection is close to the ideal measurements.
I would definitely like a thorough review on this though.
Fixes #237